<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ContentController
 *
 * @author ZW
 */
namespace Admin\Controller;
use Think\Controller;
class ContentController extends Controller{
    
    public function index(){
        $tid=isset($_GET['tid']) ? $_GET['tid'] : 0;

        $m=M('arctype');
        $list=$m->field('id,title')->select();

        $this->assign('tid',$tid);
        $this->assign('list',$list);
        $this->display();
    }

    //添加内容
    public function add(){
       if(IS_POST){

       }else{
           $tid=isset($_GET['tid']) ? $_GET['tid'] : 0;
           $mid=M('arctype')->where("id=$tid")->getField('model');

           $m=D('model');
           $arr = $m->where('id=' . $mid)->find();
           $fields = unserialize($arr['fieldset']);

           if($arr['issystem']==1){
               if($arr['type']==1){
                   $form=AutoField($fields);
               }else{

               }
           }

            $m=M('arctype');
            $list=$m->field('id,title')->select();

            $this->assign('form',$form);
            $this->assign('list',$list);
            $this->display();
        }
    }
}

?>
